﻿<view:ModuleView x:Class="UCOLOR.View.HomeView_New"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
    xmlns:helpers="clr-namespace:UCOLOR.Helpers"
    xmlns:local="clr-namespace:UCOLOR.App.Extend"
    xmlns:view="clr-namespace:UCOLOR.View"
             mc:Ignorable="d" 
             d:DesignHeight="800" d:DesignWidth="1118" FontWeight="Bold" Focusable="True">
    <view:ModuleView.Resources>
        <local:ScalablePaddingConverter x:Key="ScalablePaddingConverter"/>
        <helpers:StringFormatConverter x:Key="StringFormatConverter" />
        <helpers:ImageSourceConverter x:Key="ImageSourceConverter" />
        <Style x:Key="VerticalTile" TargetType="dxlc:Tile">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Small" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel>
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="14" Margin="0,5,0,0" HorizontalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="HorizontalTile" TargetType="dxlc:Tile">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Large" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="14" Margin="20,0,0,0" VerticalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="FlatTile" TargetType="dxlc:Tile">
            <Setter Property="Size" Value="Large" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="VerticalHeaderAlignment" Value="Stretch" />
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel>
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="24" Margin="0,5,0,0" HorizontalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </view:ModuleView.Resources>
    
    <DockPanel LastChildFill="True">
       <Grid DockPanel.Dock="Top" Name="Top" Background="#E6499F9F">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="630*"></ColumnDefinition>
                <ColumnDefinition Width="183*"></ColumnDefinition>
                <ColumnDefinition Width="305*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="100"></RowDefinition>
            </Grid.RowDefinitions>
            <Image Name="logo" Grid.Row="0" Grid.Column="0" HorizontalAlignment="left" Stretch="None" Margin="2,2,2,2"></Image>
            <StackPanel Name="toolbar" Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center" >
            </StackPanel>
            <TextBox Name="tbSearch" Grid.Column="2" Text="搜索" HorizontalAlignment="Right"  VerticalAlignment="Center" Width="203" Margin="0,34,15,36" Height="30" VerticalContentAlignment="Center" FontSize="12" FontStretch="Normal" CaretBrush="#FF229393" ClipToBounds="False" IsManipulationEnabled="True" MinLines="2"></TextBox>
            <dxlc:Tile Background="#FF6652A2" Style="{StaticResource HorizontalTile}"  dxlc:FlowLayoutControl.IsFlowBreak="True" Margin="6,10,0,6"  HorizontalAlignment="Left" Size="Large" Width="310" Header="欢迎使用..." Content="欢迎使用..."></dxlc:Tile>
            <dxlc:Tile Background="#FF6652A2" Style="{StaticResource HorizontalTile}"  dxlc:FlowLayoutControl.IsFlowBreak="True" HorizontalAlignment="Left" Margin="330,10,0,6" Size="Small" Width="146" Header="用户登录"/>
        </Grid>
        <Grid Name="Center" Background="#FFFFFFFF">
            <Grid x:Name="LayoutRoot" Width="auto" Height="auto">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="330"></ColumnDefinition>
                   
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                       <RowDefinition  />
                </Grid.RowDefinitions>
                <dxlc:TileLayoutControl Margin="0,0,0,0" Height="Auto" TileClick="TileLayoutControl_TileClick" Grid.ColumnSpan="2" Padding="10">
                    <dxlc:TileLayoutControl.Resources>
                        <Style TargetType="dxlc:Tile">
                            <Setter Property="ContentTemplate">
                                <Setter.Value>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding}" FontFamily="Segoe UI Light" FontSize="48" />
                                    </DataTemplate>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="MaximizedContentTemplate">
                                <Setter.Value>
                                    <DataTemplate>
                                        <StackPanel Orientation="Vertical" Margin="16">
                                            <TextBlock Text="{Binding}" FontFamily="Segoe UI Light" FontSize="48" />
                                            <TextBlock FontSize="14" TextWrapping="Wrap">
                                        You can define an alternative content template when Tile is maximized using the MaximizedContentTemplate property.
                                            </TextBlock>
                                        </StackPanel>
                                    </DataTemplate>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="HorizontalContentAlignment" Value="Center" />
                            <Setter Property="VerticalContentAlignment" Value="Center" />
                        </Style>
                        <SolidColorBrush x:Key="color2" Color="#FFDA8515" />
                        <SolidColorBrush x:Key="color3" Color="#FF54AF0E" />
                    </dxlc:TileLayoutControl.Resources>

                    <dxlc:Tile   Content="站内消息"   Background="#FF6652A2"  FontSize="22" Width="310" Click="Tile_Click" Height="123">
                    </dxlc:Tile>

                    <dxlc:Tile  Content="公告" Height="119">
                        <!--<BitmapImage UriSource="../Images/Statistics.png" />-->
                    </dxlc:Tile>

                    <dxlc:Tile  Content="活动" Background="#FF6652A2" Height="115">
                    </dxlc:Tile>
                    <dxlc:Tile  Header="设置" Style="{StaticResource VerticalTile}" Background="#FF54AF0E" Command="{Binding ShowSystemInfoCommand}">
                        <BitmapImage UriSource="../Images/System.png" />
                    </dxlc:Tile>
                    <dxlc:Tile  Content="用户中心" Background="#FF6652A2" Command="{Binding ShowStatisticsCommand}" Size="Small">
                    </dxlc:Tile>
                </dxlc:TileLayoutControl>
                <Grid Name="DataCenter" Background="#FFFFFFFF" Grid.Column="1">

                </Grid>
            </Grid>
        </Grid>
    </DockPanel>
</view:ModuleView>
